package com.example.mapper.tribune;


import com.example.model.entity.tribune.Like;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 操作like相关数据接口
*/
public interface LikeMapper {

    /**
      * 新增
    */
    int insert(Like like);

    /**
      * 删除
    */
    int deleteById(Integer id);

    /**
      * 修改
    */
    int updateById(Like like);

    /**
      * 根据ID查询
    */
    Like selectById(Integer id);

    /**
      * 查询所有
    */
    List<Like> selectAll(Like like);
    @Select("select * from click where userId = #{userId} and fid = #{fid} and module=#{module}")
    Like selectByUserIdAndFid(Integer userId, Integer fid, String module);
    @Select("select * from click where doctorId = #{doctorId} and fid = #{fid} and module=#{module}")
    Like selectByDoctorIdAndFid(Integer doctorId, Integer fid, String module);
}
